const { spawn } = require('child_process');
const ls = spawn('/root/.nvm/versions/node/v6.9.4/bin/node', ['out/app.js']);

ls.stdout.on('data', (data) => {
  console.log(`stdout: ${data}`);
});

ls.stderr.on('data', (data) => {
  console.error(`stderr: ${data}`);
});

ls.on('close', (code) => {
  console.log(`子进程退出，退出码 ${code}`);
});